package com.epam.task.oop.medicines;

import com.epam.task.oop.Characters.MedicineCategory;

import java.io.Serializable;

public class MedicalDevices extends PharmacyProducts implements  Serializable {
    private static final long serialVersionUID = 1L;
    private float weight;

    public MedicalDevices(String name, String manufacturer,
                          String dateSalesStart, int count, float price, int id, float weight) {
        super(name, manufacturer, dateSalesStart, count, price, id);
        this.weight = weight;

    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public String toString() {
        String res = "Name: " + this.getName() + ", id: " + this.getId()
                + ", Manufacture: " + this.getManufacturer() + " , Date sales start: " + this.getDateSalesStart()
                + " , " + this.getCount() + " pcs, price: " + this.getPrice()
                + " , Weight is: " + this.getWeight();
        return res;
    }

    @Override
    public float countCost() {
        if (getWeight()>50) {
            return this.getCount() * this.getPrice();
        }
        else {
            return this.getCount() * this.getPrice() + 100;
        }
    }
}
